<link rel="stylesheet" type="text/css" href="../Another/Style/phantrang.css"/>
<div class="phantrang-menu">
    <ul class="phantrang">
     <?php //Code phân trang
    //nếu cần hiển thị số trang
    if($page > 1)
    {
        $next= $start + $display;
        $prev= $start - $display;
        $current= ($start/$display)+1;
        //hiển thị trang previous
        if($current!=1)
        {
            echo"<li><a href='TimKiem_Chung.php?start=$prev&page=$page&timkiem_gia=".$_SESSION['gia']."&timkiem_thuonghieu=".$_SESSION['thuonghieu']."&timkiem_loai=".$_SESSION['loai']."&input=".$_SESSION['TK']."'>Previous</a></li>";
        }
        
        //hiển thị trang index
        for($i=1;$i<=$page;$i++)
        {
            if($current!=$i)
            {
                echo"<li><a href='TimKiem_Chung.php?start=".($display*($i-1))."&page=$page&timkiem_gia=".$_SESSION['gia']."&timkiem_thuonghieu=".$_SESSION['thuonghieu']."&timkiem_loai=".$_SESSION['loai']."&input=".$_SESSION['TK']."'>$i</a></li>";
            }
            else{
                echo"<li class='current'>$i</li>";
            }
        }
        //hiển thị trang previous
        if($current!=$page)
        {
            echo"<li><a href='TimKiem_Chung.php?start=$next&page=$page&timkiem_gia=".$_SESSION['gia']."&timkiem_thuonghieu=".$_SESSION['thuonghieu']."&timkiem_loai=".$_SESSION['loai']."&input=".$_SESSION['TK']."'>Next</a></li>";
        }
    }
    ?>
    </ul>
</div>